import axios from '@/utils/axios'

export const getDict = (id: string): Promise<ApiResult<SystemDict>> => {
    return axios.get(`system/dict/${id}`)
}

export const getDictPage = (pagination: Pagination, params: SystemDict): Promise<ApiResult<Page<SystemCodeVO>>> => {
    return axios.get(`system/dict/page/${pagination.page}/${pagination.pageSize}`, { params })
}

export const postOrPutDict = (data: SystemDict): Promise<ApiResult<null>> => {
    return axios.post(`system/dict`, data)
}

export const deleteDict = (id: string): Promise<ApiResult<null>> => {
    return axios.delete(`system/dict/${id}`)
}
